home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds.fmt / test.man < prev    next >
Encoding:
Text File  |  1989-04-12  |  2.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TEST                      User Commands                      TEST
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      test - condition command
  10.  
  11. SSYYNNOOPPSSIISS
  12.      tteesstt expr
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.      _t_e_s_t evaluates the expression _e_x_p_r, and if its value is true
  16.      then returns zero exit status; otherwise, a non zero exit
  17.      status is returned.  _t_e_s_t returns a non zero exit if there
  18.      are no arguments.
  19.  
  20.      The following primitives are used to construct _e_x_p_r.
  21.  
  22.      --ee file  true if the file exists and all the directories
  23.               along its path may be searched.
  24.  
  25.      --rr file  true if the file exists and is readable.
  26.  
  27.      --ww file  true if the file exists and is writable.
  28.  
  29.      --xx file  true if the file exists and is executable.
  30.  
  31.      --ff file  true if the file exists and is not a directory.
  32.  
  33.      --dd file  true if the file exists and is a directory.
  34.  
  35.      --hh file  true if the file exists and is a symbolic link.
  36.  
  37.      --ss file  true if the file exists and has a size greater than
  38.               zero.
  39.  
  40.      --tt [ fildes ]
  41.               true if the open file whose file descriptor number
  42.               is _f_i_l_d_e_s (1 by default) is associated with a ter-
  43.               minal device.
  44.  
  45.      --zz s1    true if the length of string _s_1 is zero.
  46.  
  47.      --nn s1    true if the length of the string _s_1 is nonzero.
  48.  
  49.      s1 == s2  true if the strings _s_1 and _s_2 are equal.
  50.  
  51.      s1 !!== s2 true if the strings _s_1 and _s_2 are not equal.
  52.  
  53.      s1       true if _s_1 is not the null string.
  54.  
  55.      n1 --eeqq n2
  56.               true if the integers _n_1 and _n_2 are algebraically
  57.               equal.  Any of the comparisons --nnee, --ggtt, --ggee, --lltt,
  58.               or --llee may be used in place of --eeqq.
  59.  
  60.  
  61.  
  62.  
  63. Sprite v1.0            September 22, 1987                       1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TEST                      User Commands                      TEST
  71.  
  72.  
  73.  
  74.      These primaries may be combined with the following opera-
  75.      tors:
  76.  
  77.      !!    unary negation operator
  78.  
  79.      --aa   binary _a_n_d operator
  80.  
  81.      --oo   binary _o_r operator
  82.  
  83.      (( expr ))
  84.           parentheses for grouping.
  85.  
  86.      --aa has higher precedence than --oo.. Notice that all the opera-
  87.      tors and flags are separate arguments to _t_e_s_t.  Notice also
  88.      that parentheses are meaningful to the Shell and must be
  89.      escaped.
  90.  
  91. SSEEEE AALLSSOO
  92.      sh(1), find(1)
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0            September 22, 1987                       2
  130.  
  131.  
  132.  
  133.